<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:71:"/var/www/fish/application/crm/view/logisticsreport/logisticsReport.html";i:1516864690;}*/ ?>
<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>小鱼ADMIN</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/public/static/css/font.css">
    <link rel="stylesheet" href="/public/static/css/bgadmin.css">
    <script type="text/javascript" src="/public/static/js/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="/public/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/public/static/js/bgadmin.js"></script>
	<script type="text/javascript" src="/public/static/js/jquery.form.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <style>
  .layui-input{height:30px;}
  .layui-form-label{line-height: 16px;}
  </style>
  <body>
    <div class="bg-body">
      <div class="layui-row">
        <form class="layui-form ">
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">下单时间从：</label>
              <div class="layui-input-inline">
                <input type="text" class="layui-input" id="start_createtime" name="start_createtime">
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">到：</label>
              <div class="layui-input-inline">
                <input type="text" class="layui-input" id="end_createtime" name="end_createtime">
              </div>
            </div>
            <div class="layui-inline">
			  <label class="layui-form-label">下单工号：</label>
			  <div class="layui-input-inline">
				<!--<input type="text" name="create_user" id= "create_user_id" lay-verify="" autocomplete="off" class="layui-input">-->
				<select name="create_user" id="create_user" lay-verify="" autocomplete="off" class="layui-input" lay-search="">
					<option value="">直接选择或搜索选择</option>  <!--请选择-->
					<?php if(is_array($arrUsers) || $arrUsers instanceof \think\Collection || $arrUsers instanceof \think\Paginator): $i = 0; $__LIST__ = $arrUsers;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
					<option value="<?php echo $vo['username']; ?>"><?php echo $vo['cn_name']; ?>   ( <?php echo $vo['username']; ?> ) </option>
					<?php endforeach; endif; else: echo "" ;endif; ?>
				</select>
			  </div>
			</div>
			<div class="layui-inline">
			  <label class="layui-form-label">所属部门：</label>
			  <div class="layui-input-inline">
				<select name="dept_id" id="dept_id" lay-verify="" autocomplete="off" class="layui-input" lay-search="">
					<option value="">直接选择或搜索选择</option>
					<option value="0">顶级部门</option>
					<?php echo $options; ?>
				</select>
			  </div>
			</div>
            <a class="layui-btn layui-btn-small"  style="margin-bottom: 10px;" id="search"  lay-submit="" lay-filter="search"><i class="layui-icon" >&#xe615;</i></a>
			<a class="layui-btn layui-btn-small"  style="margin-bottom: 10px;" id="export"  lay-submit="" lay-filter="export"><i class="layui-icon" >导出</i></a>
        </div>
		</form>
	  </div>

      <table class="layui-table" lay-data="{id: 'reportId', height:'full-200', url:'/index.php/crm/Logisticsreport/logisticsReportData', page:true, limit:10, limits:[10,20,30,50]}" lay-filter="demo">
        <thead>
        <tr>
          <th lay-data="{field:'cn_name', width:100, align:'center',fixed:'left'}">姓名</th>
          <th lay-data="{field:'dept_name', width:100, align:'center',fixed:'left'}">部门</th>
          <th lay-data="{field:'total_send_num', width:100, align:'center',sort:true,fixed:'left'}">总发货数</th>
          <th lay-data="{field:'total_sign_for_num', width:100, align:'center',sort:true,fixed:'left'}">总签收数</th>
          <th lay-data="{field:'total_send_money', width:100, align:'center',sort:true,fixed:'left'}">总发货金额</th>
          <th lay-data="{field:'total_sign_for_money', width:100, align:'center',sort:true,fixed:'left'}">总签收金额</th>
          <th lay-data="{field:'total_sign_for_rate', width:100, align:'center',sort:true,fixed:'left'}">总签收率</th>

          <th lay-data="{field:'ems_send_num', width:120, align:'center',sort:true}">EMS发货数</th>
          <th lay-data="{field:'ems_sign_for_num', width:120, align:'center',sort:true}">EMS签收数</th>
          <th lay-data="{field:'ems_send_omoney', width:120, align:'center',sort:true}">EMS发货金额</th>
          <th lay-data="{field:'ems_sign_for_qmoney', width:120, align:'center',sort:true}">EMS签收金额</th>
          <th lay-data="{field:'ems_sign_for_rate', width:120, align:'center',sort:true}">EMS签收率</th>

          <th lay-data="{field:'shentong_send_num', width:120, align:'center',sort:true}">申通发货数</th>
          <th lay-data="{field:'shentong_sign_for_num', width:120, align:'center',sort:true}">申通签收数</th>
          <th lay-data="{field:'shentong_send_omoney', width:120, align:'center',sort:true}">申通发货金额</th>
          <th lay-data="{field:'shentong_sign_for_qmoney', width:120, align:'center',sort:true}">申通签收金额</th>
          <th lay-data="{field:'shentong_sign_for_rate', width:120, align:'center',sort:true}">申通签收率</th>

          <th lay-data="{field:'shunfeng_send_num', width:120, align:'center',sort:true}">顺丰发货数</th>
          <th lay-data="{field:'shunfeng_sign_for_num', width:120, align:'center',sort:true}">顺丰签收数</th>
          <th lay-data="{field:'shunfeng_send_omoney', width:120, align:'center',sort:true}">顺丰发货金额</th>
          <th lay-data="{field:'shunfeng_sign_for_qmoney', width:120, align:'center',sort:true}">顺丰签收金额</th>
          <th lay-data="{field:'shunfeng_sign_for_rate', width:120, align:'center',sort:true}">顺丰签收率</th>

          <th lay-data="{field:'logistics_state0', width:100, align:'center',sort:true}">在途</th>
          <th lay-data="{field:'logistics_state1', width:100, align:'center',sort:true}">揽件</th>
          <th lay-data="{field:'logistics_state2', width:100, align:'center',sort:true}">疑难</th>
          <th lay-data="{field:'logistics_state3', width:100, align:'center',sort:true}">签收</th>
          <th lay-data="{field:'logistics_state4', width:100, align:'center',sort:true}">退签</th>
          <th lay-data="{field:'logistics_state5', width:100, align:'center',sort:true}">派件</th>
          <th lay-data="{field:'logistics_state6', width:100, align:'center',sort:true}">退回</th>
          <th lay-data="{field:'logistics_state7', width:100, align:'center',sort:true}">转投</th>
        </tr>
        </thead>
      </table>
      
    </div>

</body>
<script type="text/javascript">
layui.use(['layer', 'form','table'], function(){
    var layer = layui.layer
    ,form = layui.form
    ,table = layui.table;

    //重载数据表
    $('#search').click(function(){
        var create_user = $("#create_user").val();
        var dept_id = $("#dept_id").val();
        var start_createtime = $("#start_createtime").val();
        var end_createtime = $("#end_createtime").val();
        table.reload('reportId', {
            url: 'logisticsReportData',
            where: {
                create_user : create_user,
                dept_id : dept_id,
                start_createtime : start_createtime,
                end_createtime : end_createtime,
            } //设定异步数据接口的额外参数
        });
    });


    // 按搜索条件导出
    $('#export').click(function(){
        var createname = $("#create_user").val();
        var dept_id = $("#dept_id").val();
        var start_createtime = $("#start_createtime").val();
        var end_createtime = $("#end_createtime").val();
        
        var url = '/index.php/crm/Logisticsreport/logisticsReportData?search_type=excel&createname='+createname+'&dept_id='+dept_id+'&start_createtime='+start_createtime+'&end_createtime='+end_createtime;
        location.replace(url);
    });


});


layui.use('laydate', function(){
	var laydate = layui.laydate;
	laydate.render({
		elem: '#start_createtime'
		,type: 'datetime'
	});

	laydate.render({
		elem: '#end_createtime'
		,type: 'datetime'
	});
});




</script>

</html>